<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>周报表</title>
    <link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.form.js"></script>
    <script type="text/javascript">
        function downexcel(){

            location='${downexcel}';
        }
        function changeselect(){
            var url='<c:url value="/ads/week?m=list"/>';

            if($("#userid").val()!=""){
                url+='&userid='+$("#userid").val();
            }
            if($("#jidu").val()!=""){
                url+='&jidu='+$("#jidu").val();
            }
            location=url;
        }
    </script>
</head>
<body>
<div class="content">
    <jsp:include page="../pub/top.jsp"></jsp:include>
    <!--头部结束-->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="left" valign="top">
                <jsp:include page="../pub/left_ads.jsp"></jsp:include>
            </td>
            <td valign="top">
                <div id="c01">
                    <dl>
                            <c:if test="${sessionScope.user.permission.code=='1'}">
                                <dt style="padding-right:30px;">AE选择：
                                    <select class="sheng" name="userid" id="userid"  onchange="changeselect()">
                                        <option value="0">全部</option>
                                        <c:forEach items="${userList}" var="user">
                                            <option value="${user.id}" ${user.id ==param.userid?'selected=selected':''}><c:out value="${user.username}"/></option>
                                        </c:forEach>
                                    </select>
                                </dt>
                            </c:if>
                        <dt style="padding-right:30px;">时间选择：
                            <select id="jidu" name="jidu" style="width:100px;" onchange="changeselect()">
                                <option value="0" ${0 == param.jidu?'selected=selected':''}>本周</option>
                                <option value="1" ${1 == param.jidu?'selected=selected':''}>1周前</option>
                                <option value="2" ${2 == param.jidu?'selected=selected':''}>2周前</option>
                                <option value="3" ${3 == param.jidu?'selected=selected':''}>3周前</option>
                                <option value="4" ${4 == param.jidu?'selected=selected':''}>4周前</option>

                            </select>

                        </dt>
                        <dd style="margin-left:50px;padding-right:30px;"><input type="button" value="下载列表"  class="chaxun" onclick="downexcel()"/></dd>
                    </dl>
                    <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                        <tr>
                            <td width="5%" height="30" bgcolor="#e5edfa" align="center">序号</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center" >姓名</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center" >周计划回款</td>
                            <%--<td width="15%" height="30" bgcolor="#e5edfa" align="center">已开票</td>--%>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">周已回款</td>
                            <td width="15%" height="30" bgcolor="#e5edfa" align="center" >周待回款</td>
                        </tr>
                        <c:choose>
                            <c:when test="${not empty kpiList}">
                                <c:forEach items="${kpiList}" var="kpi" varStatus="vs">
                                    <tr>
                                        <td height="30" bgcolor="#FFFFFF" align="center">
                                            <input type="checkbox" name="kpiId" value="${kpi.id}"/>
                                            <c:out value="${vs.index+1}"/></td>

                                        <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                                            <c:out value="${kpi.user.username}"/>
                                                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                                        </td>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="color: #cc0000">
                                            <c:out value="${kpi.kipnum}"/>
                                        </td>
                                        <%--<td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">--%>
                                            <%--<c:out value="${kpi.billnum}"/>--%>
                                        <%--</td>--%>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                                            <c:out value="${kpi.doneponum}"/>
                                                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                                        </td>
                                        <td height="30" bgcolor="#FFFFFF" align="center">
                                            <c:out value="${kpi.lendnum}"/>
                                                <%--<c:out value="${clazz.industry}"/>--%>
                                        </td>

                                    </tr>
                                </c:forEach>
                                <tr>
                                    <td height="30" bgcolor="#FFFFFF" align="center"/>
                                <tr/>

                                <tr>
                                    <td height="30" bgcolor="#FFFFFF" align="center">

                                    </td>


                                    <td height="30" bgcolor="#FFFFFF" align="center">
                                        合计
                                    </td>
                                    <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">
                                        <c:out value="${sum.kipnum}"/>
                                    </td>
                                    <%--<td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">--%>
                                        <%--<c:out value="${sum.billnum}"/>--%>
                                    <%--</td>--%>
                                    <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">

                                    <c:out value="${sum.doneponum}"/>
                                     </td>
                                    <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">

                                      <c:out value="${sum.lendnum}"/>
                                    </td>
                                </tr>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="8" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                    </table>
                    <%--<p><input type="checkbox" onclick="selectAll(this)"/> 全选 --%>
                    <%--<input type="button" value="删除" class="shanchu" onclick="del(0)"/></p>--%>
                    <%--<jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>--%>
                    <jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>
                </div>
                <br />
                <br />
            </td>
        </tr>
    </table>
    <jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
